import React, { useState, useReducer } from 'react'
import MyContext from '@/store/MyContext';
import todoReducer from './todoReducer';
import activityReducer, { activityInitData } from './activityReducer';

export default function FnProvider(props) {
  const [msg, setMsg] = useState('Hi');
  // const [todoList, setTodoList] = useState([])
  const [todoList, dispatch] = useReducer(todoReducer, []);
  const [activity, acivityDispatch] = useReducer(activityReducer, activityInitData);

  return (
    <MyContext.Provider value={{
      msg,
      setMsg,
      todoList,
      dispatch,
      activity,
      acivityDispatch
    }}>
      {props.children}
    </MyContext.Provider>
  )
}
